package com.mayuran19.portal.sales.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mayuran19.portal.common.ui.pagination.PagedResultSet;
import com.mayuran19.portal.common.ui.pagination.Pager;
import com.mayuran19.portal.sales.dao.SaleHeaderDAO;
import com.mayuran19.portal.sales.database.domain.SaleHeader;
import com.mayuran19.portal.sales.service.SaleHeaderService;

@Service("saleHeaderService")
public class SaleHeaderServiceImpl implements SaleHeaderService {
	private SaleHeaderDAO saleHeaderDAO;

	@Autowired
	public void setSaleHeaderDAO(SaleHeaderDAO saleHeaderDAO) {
		this.saleHeaderDAO = saleHeaderDAO;
	}

	public SaleHeader save(SaleHeader t) {
		return this.saleHeaderDAO.save(t);
	}

	public SaleHeader update(SaleHeader t) {
		return this.saleHeaderDAO.update(t);
	}

	public SaleHeader findById(Long id) {
		return this.saleHeaderDAO.findById(id);
	}

	public SaleHeader findById(Long id, String... include) {
		return this.saleHeaderDAO.findById(id, include);
	}

	public SaleHeader delete(SaleHeader t) {
		return this.saleHeaderDAO.delete(t);
	}

	public List<SaleHeader> findAll() {
		return this.saleHeaderDAO.findAll();
	}

	public List<SaleHeader> findAll(Pager pager) {
		return this.saleHeaderDAO.findAll(pager);
	}

	public PagedResultSet paginate(Pager pager) {
		return this.saleHeaderDAO.paginate(pager);
	}

	public Integer getAllCount() {
		return this.saleHeaderDAO.getAllCount();
	}

	public Boolean isUnique(Long id, String fieldName, String fieldValue) {
		return this.saleHeaderDAO.isUnique(id, fieldName, fieldValue);
	}

}
